﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace QuanLyTuyenSinh.Reports.ReportDiem
{
    public partial class frmPhachDiemM1 : Form
    {
        public frmPhachDiemM1()
        {
            InitializeComponent();
        }


        private void frmPhachDiemM1_Load(object sender, EventArgs e)
        {
            cbKhoiPhong.DataSource = monthibus.GetKhoithiUngVoiNganhHoc();
            cbKhoiPhong.ValueMember = "Khoithi";
            cbKhoiPhong.DisplayMember = "Khoithi";
        }

        private void cmdDS_Click(object sender, EventArgs e)
        {
            var cmd = new SqlCommand("select PhachM1,DiemM1,Khoithi from TSSBD where Khoithi='" + cbKhoiPhong.Text.Trim() + "'", ConnectData.Getcon());
            var DTA = new SqlDataAdapter(cmd);
            var DTL = new DataTable();
            var DTS = new DataSet();
            DTA.Fill(DTS, "TSSBD");
            DTL = DTS.Tables["TSSBD"];
            var cry = new rptPhachDiemM1();
            cry.SetDataSource(DTL);
            CryStalPhachDiem1.ReportSource = cry;
            CryStalPhachDiem1.Refresh();
        }
    }
}